import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import router from './router/index'
//导入全局样式
import './assets/css/index.css'
//引入字体图标
import './assets/font/iconfont.css'
//引入vuex store 
import store from './store/index'
//引入axios
import axios from "axios";
//事件捕获
import 'default-passive-events'
//按需加载 element组件
import { Cascader, MessageBox, Upload } from 'element-ui'
//引入 echarts 图表
import * as echarts from 'echarts'
//引入表单
import { Table, TableColumn, Notification, DescriptionsItem } from 'element-ui'


//所有学科element-ui组件
import { Button } from 'element-ui';
import { Row } from 'element-ui';
import { Col } from 'element-ui';
import { Menu } from 'element-ui';
import { Submenu } from 'element-ui';
import { MenuItemGroup } from 'element-ui';
import { MenuItem } from 'element-ui';

//导航显示element-ui组件
import { Tabs } from 'element-ui'
import { TabPane } from 'element-ui'

// 个人信息element-ui组件
import { RadioGroup } from 'element-ui'
import { Radio } from 'element-ui'
import { Drawer } from 'element-ui';


// 个人信息表单elemnet-ui组件
import { RadioButton } from 'element-ui';
import { Form } from 'element-ui';
import { FormItem } from 'element-ui';
import { Input } from "element-ui";
import { DatePicker } from 'element-ui'

//弹框提示登录错误信息element-ui组件
import { Dialog } from 'element-ui'

//操作提示
import { Popconfirm } from 'element-ui'
// 管理员登录系统首页 element-ui
import { Calendar } from 'element-ui'
import { Checkbox } from 'element-ui'
import { Tree } from 'element-ui'

// 管理员登录系统学科界面表单 || 学科多选框element-ui
import { Select } from 'element-ui'
import { Option } from 'element-ui'
import { Switch } from 'element-ui'
import { CheckboxGroup } from 'element-ui'
import { TimePicker } from 'element-ui'
import { Icon } from 'element-ui'
import { Message } from 'element-ui';

//项目下拉框
import { Dropdown } from 'element-ui'
import { DropdownMenu } from 'element-ui'
import { DropdownItem } from 'element-ui'

//进度条
import { Progress } from 'element-ui'

//导航头
import { PageHeader } from 'element-ui'
import { Transfer } from 'element-ui'

import { Image } from 'element-ui'
//分页
import { Pagination } from 'element-ui'

// 分割线 
import { Divider } from 'element-ui'

// 文字提示
import { Tooltip } from 'element-ui'
// 空状态
import { Empty } from 'element-ui'


Vue.component('el-image', Image)
Vue.component('el-pagination', Pagination)
Vue.component('el-transfer', Transfer)
import { Breadcrumb } from 'element-ui';
import { BreadcrumbItem } from 'element-ui'
import { Tag } from 'element-ui'
import { Badge } from 'element-ui'
import { Descriptions } from 'element-ui'
import { Popover } from 'element-ui'
import { Avatar } from 'element-ui'
//折叠组件
import { Collapse } from 'element-ui'
import { CollapseItem } from 'element-ui'
//折叠组件
Vue.component('el-collapse', Collapse)
Vue.component('el-collapse-item', CollapseItem)

Vue.component('el-avatar', Avatar)
Vue.config.productionTip = false
Vue.prototype.$confirm = MessageBox.confirm
//学科组件名 ➕ 组件
Vue.component('form-button', Button)
Vue.component('form-row', Row)
Vue.component('form-col', Col)
Vue.component('form-menu', Menu)
Vue.component('form-submenu', Submenu)
Vue.component('form-MenuItem', MenuItem)
Vue.component('form-menuItemGroup', MenuItemGroup)

//导航组件名➕ 组件
Vue.component('nav-tabs', Tabs)
Vue.component('nav-tab-pane', TabPane)

//个人信息组件名+组件
Vue.component('msg-radio-group', RadioGroup)
Vue.component('msg-radio', Radio)
Vue.component('msg-button', Button)
Vue.component('msg-drawer', Drawer)


// 个人信息表单
Vue.component('form-radio-group', RadioGroup)
Vue.component('form-radio-button', RadioButton)
Vue.component('f-form', Form)
Vue.component('form-item', FormItem)
Vue.component('form-input', Input)
Vue.component('form-picker', DatePicker)
Vue.component('form-timePicker', TimePicker)

//弹框提示登录错误信息
Vue.component('alter-dialog', Dialog)
Vue.component('alter-button', Button)

////学科多选框
Vue.component('el-select', Select)
Vue.component('el-option', Option)

//开启项目弹框操作
Vue.component('el-dialog', Dialog)
Vue.component('el-button', Button)

// 按钮
Vue.component('btn-row', Row)

//操作提示
Vue.component('popconfirm', Popconfirm)
Vue.component('btn', Button)
Vue.component('el-tooltip', Tooltip)

// 空状态
Vue.component('el-empty', Empty)

Vue.use(VueRouter)
Vue.prototype.$ajax = axios

//处理路由异常的问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}


//导入混入
import { mixin } from './mixin'
Vue.mixin(mixin)

import { InfiniteScroll } from 'element-ui';
Vue.use(InfiniteScroll) 


Vue.component('form-radio-group', RadioGroup)
Vue.component('form-radio-button', RadioButton)
Vue.component('f-form', Form)
Vue.component('form-item', FormItem)
Vue.component('form-input', Input)

//项目下拉框
Vue.component('el-dropdown', Dropdown)
Vue.component('el-dropdown-menu', DropdownMenu)
Vue.component('el-dropdown-item', DropdownItem)

//弹框提示登录错误信息
Vue.component('alter-dialog', Dialog)
Vue.component('alter-button', Button)

// 管理员登录首页
Vue.component('el-calendar', Calendar)
Vue.component('el-checkbox', Checkbox)
Vue.component('el-tree', Tree)

// 管理员登录系统学科界面表单
Vue.component('el-select', Select)
Vue.component('el-option', Option)
Vue.component('el-switch', Switch)
Vue.component('el-checkbox-group', CheckboxGroup)
Vue.component('el-date-picker', DatePicker)
Vue.component('el-time-picker', TimePicker)
Vue.component('el-cascader', Cascader)
Vue.component('el-icon', Icon)
Vue.component('el-breadcrumb', Breadcrumb)
Vue.component('el-breadcrumb-item', BreadcrumbItem)
Vue.component('el-pagination', Pagination)
Vue.component('el-upload', Upload)
Vue.component('el-tag', Tag)
Vue.component('el-badge', Badge)
Vue.component('el-descriptions', Descriptions)
Vue.component('el-popover', Popover)

Vue.component('el-divider',Divider)

//进度条
Vue.component('el-progress', Progress)

//消息头
Vue.component('el-page-header', PageHeader)
Vue.use(VueRouter)
//使用表单
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(DescriptionsItem)
Vue.use(Image)
Vue.component(Message.name, Message)
Vue.prototype.$message = Message
Vue.prototype.$ajax = axios
Vue.prototype.$echarts = echarts
Vue.prototype.$notify = Notification

// axios.defaults.withCredentials = true
// axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'

import request from '@/api/utils/request'
Vue.prototype.$http = request

new Vue({
  render: h => h(App),
  router,
  store,
  beforeCreate() {
    Vue.prototype.$bus = this
  }
}).$mount('#app')
